Add hb-blob-private.hh
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 4 May 2018 01:10:57 +0000 (21:10 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 7 May 2018 20:38:19 +0000 (13:38 -0700)
Towards making blob more memory-allocation-friendly

src/Makefile.sources
src/hb-blob.cc

index 1ed64fe..9fbb71e 100644 (file)
@@ -2,6 +2,7 @@
 
 HB_BASE_sources = \
        hb-atomic-private.hh \
+       hb-blob-private.hh \
        hb-blob.cc \
        hb-buffer-private.hh \
        hb-buffer-serialize.cc \
index 710765d..1435d30 100644 (file)
@@ -31,8 +31,7 @@
 
 #include "hb-private.hh"
 #include "hb-debug.hh"
-
-#include "hb-object-private.hh"
+#include "hb-blob-private.hh"
 
 #ifdef HAVE_SYS_MMAN_H
 #ifdef HAVE_UNISTD_H
 #include <fcntl.h>
 
 
-struct hb_blob_t {
-  hb_object_header_t header;
-  ASSERT_POD ();
-
-  bool immutable;
-
-  const char *data;
-  unsigned int length;
-  hb_memory_mode_t mode;
-
-  void *user_data;
-  hb_destroy_func_t destroy;
-};
-
 
 static bool _try_writable (hb_blob_t *blob);
 
@@ -507,6 +492,10 @@ _try_writable (hb_blob_t *blob)
   return true;
 }
 
+/*
+ * Mmap
+ */
+
 #if defined(_WIN32) || defined(__CYGWIN__)
 #include <windows.h>
 #include <io.h>