testshmdll.cpp 473 B

123456789101112131415161718192021222324252627
  1. // testshmdll.cpp : 定义 DLL 的导出函数。
  2. //
  3. #include "testshmdll.h"
  4. #include "shm.h"
  5. struct Test
  6. {
  7. int a = 2;
  8. int c = 3;
  9. };
  10. extern "C" TESTSHMDLL_API void* DllMalloc(size_t bytes)
  11. {
  12. return bg::ShmMalloc(bytes);
  13. }
  14. extern "C" TESTSHMDLL_API void* DllRealloc(void* old_ptr, size_t new_bytes)
  15. {
  16. return bg::ShmRealloc(old_ptr, new_bytes);
  17. }
  18. extern "C" TESTSHMDLL_API void DllFree(void* ptr)
  19. {
  20. bg::ShmFree(ptr);
  21. }