Rework memory management, use per-thread arenas
This commit is contained in:
6
baked.c
6
baked.c
@ -3,10 +3,11 @@
|
||||
#include "gebs/gebs.h"
|
||||
#include "incbin/incbin.h"
|
||||
#include "stb/stb_ds.h"
|
||||
#include "zip.h"
|
||||
|
||||
#include "baked.h"
|
||||
#include "locked.h"
|
||||
#include "zip.h"
|
||||
#include "CONFIG.h"
|
||||
|
||||
INCBIN(bundle_zip, "./bundle.zip");
|
||||
|
||||
@ -37,7 +38,7 @@ void init_baked_resources(void)
|
||||
{
|
||||
lockx(&baked_resources);
|
||||
|
||||
struct zip_t *zip = zip_stream_open(bundle_zip_data, bundle_zip_size, ZIP_DEFAULT_COMPRESSION_LEVEL, 'r');
|
||||
struct zip_t *zip = zip_stream_open(bundle_zip_data, bundle_zip_size, BUNDLE_ZIP_COMPRESSION, 'r');
|
||||
size_t n = zip_entries_total(zip);
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
zip_entry_openbyindex(zip, i);
|
||||
@ -73,7 +74,6 @@ bool get_baked_resource_path(char *key, char *buf, size_t size)
|
||||
if (shgeti(baked_resources.value, key) != -1) {
|
||||
Baked_Resource_Value brv = shget(baked_resources.value, key);
|
||||
snprintf(buf, size, "/proc/%d/fd/%d", getpid(), brv.memfd);
|
||||
unlockx(&baked_resources);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user