aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-08-27 13:06:58 -0600
committerJon Ashburn <jon@lunarg.com>2015-09-04 15:46:31 -0600
commitdc474d1852efb52a666053ab6021ef71fbecda90 (patch)
tree49d4c2294e2c0e10dcfeecca762a2e92105c7f21 /loader
parent5666d03cc16f1497bab00b573f7484036d182983 (diff)
downloadusermoji-dc474d1852efb52a666053ab6021ef71fbecda90.tar.xz
loader: convert to using loader_stack_alloc for consistency
Diffstat (limited to 'loader')
-rw-r--r--loader/debug_report.c8
-rw-r--r--loader/loader.c2
2 files changed, 3 insertions, 7 deletions
diff --git a/loader/debug_report.c b/loader/debug_report.c
index c860b86c..752ddff8 100644
--- a/loader/debug_report.c
+++ b/loader/debug_report.c
@@ -32,7 +32,6 @@
#include <stdlib.h>
#include <inttypes.h>
#ifndef WIN32
-#include <alloca.h>
#include <signal.h>
#else
#endif
@@ -289,11 +288,8 @@ static void VKAPI StringCallback(
strlen(pLayerPrefix) +
strlen(pMsg) +
50 /* other / whitespace */;
-#ifdef WIN32
- buf = _alloca(buf_size);
-#else
- buf = alloca(buf_size);
-#endif
+ buf = loader_stack_alloc(buf_size);
+
snprintf(buf, buf_size, "%s (%s): object: 0x%" PRIxLEAST64 " type: %d location: %zu msgCode: %d: %s",
pLayerPrefix, msg_flags, srcObject, objType, location, msgCode, pMsg);
callback(buf);
diff --git a/loader/loader.c b/loader/loader.c
index 0ab7ca30..11eda894 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1588,7 +1588,7 @@ static void loader_get_manifest_files(const char *env_override,
// only Linux has relative paths
char *dir;
// make a copy of location so it isn't modified
- dir = alloca(strlen(location) + 1);
+ dir = loader_stack_alloc(strlen(location) + 1);
if (dir == NULL) {
loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Out of memory can't get manifest files");
return;