summaryrefslogtreecommitdiffstats
path: root/src/lib/netlist/plib/palloc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/plib/palloc.cpp')
-rw-r--r--src/lib/netlist/plib/palloc.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/lib/netlist/plib/palloc.cpp b/src/lib/netlist/plib/palloc.cpp
index f7a9117f503..ef9e42dcba5 100644
--- a/src/lib/netlist/plib/palloc.cpp
+++ b/src/lib/netlist/plib/palloc.cpp
@@ -9,8 +9,10 @@
#include "pconfig.h"
#include "palloc.h"
+#include "pfmtlog.h"
namespace plib {
+
//============================================================
// Exceptions
//============================================================
@@ -18,9 +20,42 @@ namespace plib {
pexception::pexception(const pstring text)
{
m_text = text;
- fprintf(stderr, "%s\n", m_text.cstr());
}
+file_e::file_e(const pstring fmt, const pstring &filename)
+ : pexception(pfmt(fmt)(filename))
+{
+}
+
+file_open_e::file_open_e(const pstring &filename)
+ : file_e("File open failed: {}", filename)
+{
+}
+
+file_read_e::file_read_e(const pstring &filename)
+ : file_e("File read failed: {}", filename)
+{
+}
+
+file_write_e::file_write_e(const pstring &filename)
+ : file_e("File write failed: {}", filename)
+{
+}
+
+null_argument_e::null_argument_e(const pstring &argument)
+ : pexception(pfmt("Null argument passed: {}")(argument))
+{
+}
+
+out_of_mem_e::out_of_mem_e(const pstring &location)
+ : pexception(pfmt("Out of memory: {}")(location))
+{
+}
+
+//============================================================
+// Memory pool
+//============================================================
+
mempool::mempool(int min_alloc, int min_align)
: m_min_alloc(min_alloc), m_min_align(min_align)
{