Skip to content

Crazyokd/bmem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bmem

batch memory - 批量内存

Usage

#include "bmem.h"

int main()
{
    bm_context_t *ctx = bm_context_register(8, 1024, 1024);
    if (ctx == NULL) return -1;
    int *a = bm_malloc(ctx, sizeof(int));
    bm_free_s(a, sizeof(int));

    int *b = bm_malloc(ctx, sizeof(int));
    bm_free(ctx, b);
    bm_context_destroy(ctx);
    return 0;
}

Target

  • allocate and release memory with O(1) complexity

Design

Design

Roadmap

  • add performance test
  • support expansion automatically
  • using hash for boosting table query speed
  • support multithread

About

a pool for "batch memory"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published