MCPcopy Create free account
hub / github.com/NetHack/NetHack / init_glyph_cache

Function init_glyph_cache

src/glyphs.c:333–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331 */
332
333staticfn void
334init_glyph_cache(void)
335{
336 size_t glyph;
337
338 /* Cache size of power of 2 not less than 2*MAX_GLYPH */
339 glyphid_cache_lsize = 0;
340 glyphid_cache_size = 1;
341 while (glyphid_cache_size < 2*MAX_GLYPH) {
342 ++glyphid_cache_lsize;
343 glyphid_cache_size <<= 1;
344 }
345
346 glyphid_cache = (struct glyphid_cache_t *) alloc(
347 glyphid_cache_size * sizeof (struct glyphid_cache_t));
348 for (glyph = 0; glyph < glyphid_cache_size; ++glyph) {
349 glyphid_cache[glyph].glyphnum = 0;
350 glyphid_cache[glyph].id = (char *) 0;
351 }
352}
353
354void
355free_glyphid_cache(void)

Callers 1

fill_glyphid_cacheFunction · 0.85

Calls 1

allocFunction · 0.70

Tested by

no test coverage detected